FROM ubuntu:bionic as builder
RUN apt-get update 
RUN apt-get install -y \
    build-essential \
    git \
    autoconf \
    libtool \
    libnuma-dev 
# RUN rm -rf /var/lib/apt/lists/*

#download the src
RUN mkdir /code &&cd /code \ 
&& git clone --depth=1  https://gitee.com/lovewinner/rt-app.git 
RUN cd /code && git clone -b json-c-0.13.1-20180305 --depth=1 https://gitee.com/lovewinner/json-c.git

# make json-c 
RUN cd /code/json-c && ./autogen.sh  \
&& ./configure \
&& make \
&& make install   

# make rt-app
RUN cd /code/rt-app \
&& export ac_cv_lib_json_c_json_object_from_file=yes \
&& export ac_cv_lib_numa_numa_available=yes \
&& ./autogen.sh \
&& ./configure  LDFLAGS="-L$PWD/../json-c" \
&& AM_LDFLAGS="-all-static" make \
&& make install 

#ADD /test/rt-8.json /test/
